-
Notifications
You must be signed in to change notification settings - Fork 1.2k
closure: make Block_descriptor_1
conform to the ABI
#1614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Blocks ABI v1 used `unsigned long int` for the `size` and `reserved` fields. On LLP64 targets (e.g. Windows x86_64), `uintptr_t` is larger than `unsigned long int`. Adjust the types to make the definition conform to the ABI specification.
@swift-ci please test |
I assume clang is the one emitting this on Windows then? What definition for the struct does it use? |
@parkera: correct. It uses
Also, note that this change will be ABI compatible on all non-LLP64 targets |
@parkera seems like a pretty simple case? |
The root of the question is me wondering if the first two values should be 64 bits on LLP64, like they would be on LP64. I suppose that would require an update to clang when targeting Windows. However, when looking at the rest of the source here it doesn't appear to be actually used by the runtime so I guess this is ok. |
Sure, we could look at altering the definition in LLP64 since we don't expect there to be many users right now. I think that is beyond the scope of this change and we should discuss that with @rjmccall first. |
That's an interesting question. I think the intent of the specification is probably to always get a pointer-sized integer, yes; that is, the I think that is a change we can reasonably make, but yeah, it's really up to the libclosure mantainers (CC @gparker42), as well as needing changes to clang and (I think) gcc. |
Yes, the intent is |
The Blocks ABI v1 used
unsigned long int
for thesize
andreserved
fields. On LLP64 targets (e.g. Windows x86_64),
uintptr_t
is largerthan
unsigned long int
. Adjust the types to make the definitionconform to the ABI specification.